Auto merge of #2681 - alexcrichton:cargo-env-home, r=brson
authorbors <bors@rust-lang.org>
Fri, 13 May 2016 00:28:15 +0000 (17:28 -0700)
committerbors <bors@rust-lang.org>
Fri, 13 May 2016 00:28:15 +0000 (17:28 -0700)
commit0907288d30067f876b0611266e882adc4e5fcc72
tree4015d8230b0659f01acd78dac113d09b962c52b9
parenta046b78e75a22a83c0b4a86212555bc2c74580d7
parentee0b7117321d850fa340f9102f224cc7b1d0948e
Auto merge of #2681 - alexcrichton:cargo-env-home, r=brson

Canonicalize CARGO_HOME fallback on Windows

This commit ensures that we always return the same fallback value on Windows
regardless of whichever shell we happen to be run from. We do this by removing
the `$HOME` environment variable which `std::env::home_dir` will inspect to
force it to fall back to the system APIs. If the old directory exists then we
favor that one, but otherwise we favor locations like `C:\Users\$user`

Supercedes and closes #2604
src/cargo/util/config.rs
tests/tests.rs